<?php
App::uses('AppController', 'Controller');

class CategoriesController extends AppController {

	public function index() {

		// find all categories
		$categories = $this->Category->find('all');
		$this->set(array(
			'categories' => $categories,
		));
	}

	public function view($id) {

		// find category by id
		$category = $this->Category->find('first', array(
			'conditions' => array('Category.id' => $id),
		));
		$this->set(array(
			'category' => $category,
		));
	}

}
